<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

    <a id="reslut" href="https://www.baidu.com/">百度</a>
    <script>
        // 如何阻止点击a链接标签跳转 a标签文字改变，但是不跳转

        // 阻止默认事件，通过阻止a 标签的默认跳转行为而实现，e.preventDefault();
        // var result = document.getElementById("reslut");
        // result.onclick = function (e) {
        //     e.preventDefault();
        // }
        var a1=[1,2,12];
        a1.sort();
        console.log(a1.sort());

    </script>
</body>

</html>